package com.canaan.business.domain.storehouse;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.canaan.common.annotation.Excel;
import com.canaan.common.annotation.TableName;
import com.canaan.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Positive;
import java.util.Date;
import java.util.List;

/**
 * 条码记录对象 wms_barcode_record
 *
 * @author ruoyi
 * @date 2022-11-30
 */
@TableName("wms_barcode_record")
public class WmsBarcodeRecord extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键ID */
    private Long id;

    /** 编号 */
    @Excel(name = "编号")
    private String no;

    /** 条码 */
    @Excel(name = "条码")
    private String barCode;

    /** 批次号 */
    @Excel(name = "批次号")
    private String batchNo;

    /** 物料编号 */
    @Excel(name = "物料编号")
    private String productNo;

    /** 物料名称 */
    @Excel(name = "物料名称")
    private String productName;

    /** PDA查询条件 */
    @Excel(name = "PDA查询条件")
    private String noOrName;

    /** 数量 */
    @Excel(name = "数量")
    private Long quantity;

    /** 0待入库，2已入库 */
    @Excel(name = "0待入库，2已入库")
    private Long status;

    /** 订单号 */
    @Excel(name = "订单号")
    private String orderNo;

    /** 生产日期 */
    @Excel(name = "生产日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date productionDate;

    /** 生产日期 */
    private String productionDateStr;

    /** 有效天数 */
    @Excel(name = "有效天数")
    private Integer validDateNum;

    /** 有效日期 */
    @Excel(name = "有效日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date effectiveDate;

    /** 供应商名称 */
    @Excel(name = "供应商名称")
    private String supplierName;

    /** 条码编号列表 */
    @Excel(name = "条码编号列表")
    private List<String> barCodes;

    public List<String> getBarCodes() {
        return barCodes;
    }

    public void setBarCodes(List<String> barCodes) {
        this.barCodes = barCodes;
    }

    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId()
    {
        return id;
    }
    public void setNo(String no)
    {
        this.no = no;
    }

    public String getNoOrName() {
        return noOrName;
    }

    public void setNoOrName(String noOrName) {
        this.noOrName = noOrName;
    }

    public String getNo()
    {
        return no;
    }
    public void setBarCode(String barCode)
    {
        this.barCode = barCode;
    }
//    @NotBlank(message = "条码号不能为空")
    public String getBarCode()
    {
        return barCode;
    }
    public void setProductNo(String productNo)
    {
        this.productNo = productNo;
    }
    @NotBlank(message = "物料编号不能为空")
    public String getProductNo()
    {
        return productNo;
    }
    public void setQuantity(Long quantity)
    {
        this.quantity = quantity;
    }
    @NotNull(message = "数量不能为空")
    @Positive(message = "数量必须为正整数")
//    @Pattern(regexp= "/^[1-9]+\\\\d*$",message = "数量必须为正整数")
    public Long getQuantity()
    {
        return quantity;
    }
    public void setStatus(Long status)
    {
        this.status = status;
    }

    public Long getStatus()
    {
        return status;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("no", getNo())
            .append("barCode", getBarCode())
            .append("productNo", getProductNo())
            .append("quantity", getQuantity())
            .append("status", getStatus())
            .append("createBy", getCreateBy())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("createTime", getCreateTime())
            .toString();
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public Date getProductionDate() {
        return productionDate;
    }

    public void setProductionDate(Date productionDate) {
        this.productionDate = productionDate;
    }

    public Integer getValidDateNum() {
        return validDateNum;
    }

    public void setValidDateNum(Integer validDateNum) {
        this.validDateNum = validDateNum;
    }

    public Date getEffectiveDate() {
        return effectiveDate;
    }

    public void setEffectiveDate(Date effectiveDate) {
        this.effectiveDate = effectiveDate;
    }

    public String getSupplierName() {
        return supplierName;
    }

    public void setSupplierName(String supplierName) {
        this.supplierName = supplierName;
    }

    public String getBatchNo() {
        return batchNo;
    }

    public void setBatchNo(String batchNo) {
        this.batchNo = batchNo;
    }

    public String getProductionDateStr() {
        return productionDateStr;
    }

    public void setProductionDateStr(String productionDateStr) {
        this.productionDateStr = productionDateStr;
    }
}
